package com.wss.day10;

import java.util.function.Consumer;

/**
 * @author wangshaoshuai
 * @desc TODO
 * @date 2025/5/7
 */
public class ConsumerPrint {
    public static void main(String[] args) {
        String[] array = { "张三,女", "李四,女", "王二麻,男" };

        Consumer<String> printName = name -> System.out.print("姓名：" + name + "。");

        Consumer<String> printGender = gender -> System.out.println("性别：" + gender + "。");

        for (String item : array) {
            String[] parts = item.split(",");
            String name = parts[0];
            String gender = parts[1];

            printName.accept(name);
            printGender.accept(gender);
        }
    }
}
